﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace FastShell.Common.Model
{
    public class HostTreeModel :  INotifyPropertyChanged
    {
        #region 私有变量
        /// <summary>
        /// Id值
        /// </summary>
        private string _id;
        /// <summary>
        /// 显示的名称
        /// </summary>
        private string _name;
        /// <summary>
        /// 图标路径
        /// </summary>
        private string _icon;



       
        #endregion



        /// <summary>
        /// 键值
        /// </summary>
        public string Id
        {
            get { return _id; }
            set { _id = value; }
        }

        /// <summary>
        /// 显示的字符
        /// </summary>
        public string Name
        {
            get { return _name; }
            set { _name = value; PropertyChanged(this, new PropertyChangedEventArgs("Name")); }
        }

        /// <summary>
        /// 图标
        /// </summary>
        public string Icon
        {
            get { return _icon; }
            set { _icon = value; }
        }

        private ObservableCollection<HostTreeModel> _children;
        /// <summary>
        /// 类型
        /// </summary>
        public string Type { get; set; }

        public string Host { get; set; }

        public string Port { get; set; }

        public string UserName { get; set; }

        public Authentication Authentication { get; set; }

        public HostTreeModel Parent { get; set; }


        /// <summary>
        /// 子项
        /// </summary>
        public ObservableCollection<HostTreeModel> Children { get { return _children; }
            set {
                _children = value;
                PropertyChanged(this, new PropertyChangedEventArgs("Children"));
            }
        }
        public event PropertyChangedEventHandler PropertyChanged = delegate { };
    }
}
